import request from '@/utils/request'

// 根据扫描得到的设备编号返回商户信息
export function getByEquipmentNo(data) {
	return request({
		url: '/front/equipment/getByEquipmentNo',
		method: 'GET',
		data,
		isLoading: false
	})
}

// 分页获取设备中的商品
export function equipmentProductPage(data) {
	return request({
		url: '/front/equipment/equipmentProductPage',
		method: 'GET',
		data,
		isLoading: false
	})
}

// 售货机确认订单
export function mechineConfirmOrder(data) {
	return request({
		url: '/front/order/mechineConfirmOrder',
		method: 'POST',
		data
	})
}

// 售货机生成订单
export function mechineCreateOrder(data) {
	return request({
		url: '/front/order/mechineCreateOrder',
		method: 'POST',
		data
	})
}

// 根据订单编号获取开门指令
export function openMechine(data) {
	return request({
		url: '/front/order/openMechine',
		method: 'POST',
		data
	})
}

// 更新设备状态
export function updateStatus(data) {
	return request({
		url: '/front/equipment/updateStatus',
		method: 'POST',
		data,
		isLoading: false
	})
}

// 获取充电配置
export function pownerRechargeSet(data) {
	return request({
		url: '/front/pownerRechargeSet/all',
		method: 'GET',
		data,
		isLoading: false
	})
}

// 充电配置
export function pownerRecharge(data) {
	return request({
		url: '/front/pownerRechargeSet/pownerRecharge',
		method: 'POST',
		data,
		isLoading: false
	})
}


export function pownerRechargeMechine(data) {
	return request({
		url: '/front/pownerRechargeSet/pownerRechargeMechine',
		method: 'POST',
		data,
		isLoading: false
	})
}

//获取充电状态
export function getPownerRechargeSetById(data) {
	return request({
		url: '/front/pownerRechargeSet/getPownerRechargeSetById',
		method: 'GET',
		data,
		isLoading: false
	})
}
